package com.guet.controller.user;

import com.guet.DTO.NotificationDTO;
import com.guet.service.NotificationService;
import com.guet.result.PageResult;
import com.guet.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("studentNotificationController")
@RequestMapping("/student/notification")
@CrossOrigin
@Slf4j
public class NotificationController {
    @Autowired
    private NotificationService notificationService;

    @PostMapping
    public Result<PageResult> queryNotification(@RequestBody NotificationDTO notificationDTO) {
        log.info("notificationDTO: {}", notificationDTO);
        PageResult result = notificationService.list(notificationDTO);
        return Result.success(result);
    }
}
